/* 医生详情页面样式 */
.doctor-detail-page {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding-bottom: 80px;
}

/* 顶部导航栏 */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #333;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.back-btn:hover {
  background-color: #f0f0f0;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
  flex: 1;
  text-align: center;
}

.nav-actions {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.nav-btn:hover {
  background-color: #f0f0f0;
}

/* 医生信息卡片 */
.doctor-info-card {
  background-color: #fff;
  margin: 16px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.doctor-profile {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
}

.avatar-container {
  margin-right: 16px;
  flex-shrink: 0;
}

.doctor-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e8f4fd;
}

.doctor-basic-info {
  flex: 1;
  min-width: 0;
}

.doctor-name {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.doctor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.divider {
  color: #ccc;
}

.hospital-name {
  font-size: 13px;
  color: #999;
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #ff6b35, #ee5a24);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.follow-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.follow-btn.followed {
  background: #52c41a;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.follow-btn.followed:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

.view-concern-btn {
  position: absolute;
  top: 0;
  right: 80px;
  background: linear-gradient(135deg, #1890ff, #40a9ff);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.view-concern-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
  background: linear-gradient(135deg, #096dd9, #1890ff);
}

.follow-icon {
  font-size: 16px;
  font-weight: bold;
}

/* 统计数据 */
.doctor-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #999;
}

/* 专长描述 */
.expertise-section {
  position: relative;
}

.expertise-text {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 12px 0;
  padding-right: 80px;
  /* 文字溢出隐藏 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-all;
  max-height: 4.8em; /* 3行的高度 */
  transition: max-height 0.3s ease;
}

.expertise-text.expanded {
  display: block;
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}

.view-profile-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  color: #1890ff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.view-profile-btn:hover {
  text-decoration: underline;
}

/* 医生服务 */
.services-section {
  background-color: #fff;
  margin: 16px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 20px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: 12px;
  transition: all 0.3s;
  text-align: center;
  cursor: pointer;
}

.service-item.active {
  background-color: #f8f9fa;
  border: 1px solid #e8f4fd;
}

.service-item.disabled {
  background-color: #f5f5f5;
  opacity: 0.6;
}

.service-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 28px;
  position: relative;
}

.service-icon.online-consultation {
  background: linear-gradient(135deg, #1890ff, #40a9ff);
  color: white;
}

.service-icon.prescription {
  background: linear-gradient(135deg, #722ed1, #9254de);
  color: white;
}

.service-icon.pharmacy {
  background: linear-gradient(135deg, #fa8c16, #ffa940);
  color: white;
}

.service-icon.clinic {
  background: linear-gradient(135deg, #d9d9d9, #bfbfbf);
  color: white;
}

/* 为优选药房添加星星装饰 */
.service-icon.pharmacy::after {
  content: '★';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 16px;
  color: #fa8c16;
  background: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.service-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.service-info p {
  font-size: 11px;
  color: #999;
  margin: 0;
  line-height: 1.2;
}

/* 评价列表 */
.reviews-section {
  background-color: #fff;
  margin: 16px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.view-more-btn {
  background: none;
  border: none;
  color: #1890ff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.view-more-btn:hover {
  text-decoration: underline;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.comments-stats {
  padding: 8px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.stats-text {
  font-size: 13px;
  color: #666;
  font-style: italic;
}

.add-comment-btn {
  background: #1890ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.add-comment-btn:hover {
  background: #096dd9;
  transform: translateY(-1px);
}

.reviews-list {
  margin-bottom: 20px;
}

.review-item {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.review-item:last-child {
  border-bottom: none;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reviewer-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.rating {
  display: flex;
  gap: 2px;
}

.star {
  color: #faad14;
  font-size: 14px;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tag {
  background-color: #f5f5f5;
  color: #666;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.review-content {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 8px;
  padding: 8px 0;
}

.doctor-reply {
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  border-left: 3px solid #1890ff;
}

.review-timestamp {
  font-size: 12px;
  color: #999;
}

.review-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.reply-btn {
  background: none;
  border: none;
  color: #1890ff;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.reply-btn:hover {
  background-color: #f0f8ff;
  color: #096dd9;
}

/* 评论表单样式 */
.comment-form-container {
  background-color: #fff;
  border: 1px solid #e8f4fd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.data-persistence-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #52c41a;
}

.notice-icon {
  font-size: 16px;
}

.notice-text {
  flex: 1;
  line-height: 1.4;
}

.comment-form-header h4 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background-color: #f5f5f5;
  color: #666;
}

.rating-section,
.tags-section,
.content-section {
  margin-bottom: 20px;
}

.rating-section label,
.tags-section label,
.content-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.rating-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.3;
}

.star-btn.active {
  opacity: 1;
  transform: scale(1.1);
}

.star-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.rating-text {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background: #f5f5f5;
  border: 1px solid #d9d9d9;
  color: #666;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-btn.active {
  background: #1890ff;
  color: white;
  border-color: #1890ff;
}

.tag-btn:hover {
  background: #e6f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

.tag-btn.active:hover {
  background: #096dd9;
  color: white;
}

.comment-input {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;
}

.comment-input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.cancel-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #d9d9d9;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn:hover {
  background: #e8e8e8;
  border-color: #bfbfbf;
}

.submit-btn {
  background: #1890ff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover:not(:disabled) {
  background: #096dd9;
  transform: translateY(-1px);
}

.submit-btn:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
  transform: none;
}

.clear-comments-btn {
  background: #ff4d4f;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.clear-comments-btn:hover {
  background: #ff7875;
  transform: translateY(-1px);
}

.clear-comments-btn:active {
  background: #d9363e;
  transform: translateY(0);
}

/* 回复输入框样式 */
.reply-input-container {
  margin-top: 12px;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8f4fd;
}

.reply-input {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;
}

.reply-input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.reply-submit-btn {
  background: #1890ff;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.reply-submit-btn:hover:not(:disabled) {
  background: #096dd9;
  transform: translateY(-1px);
}

.reply-submit-btn:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
  transform: none;
}

.reply-cancel-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #d9d9d9;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.reply-cancel-btn:hover {
  background: #e8e8e8;
  border-color: #bfbfbf;
}

/* 轻提示样式 */
.toast-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast-message.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 关注成功动画样式 */
.follow-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, #52c41a, #73d13d);
  color: white;
  padding: 20px 30px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(82, 196, 26, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.follow-animation.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.animation-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.animation-icon {
  font-size: 24px;
  font-weight: bold;
  color: white;
}

.animation-text {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

/* 咨询记录 */
.consultation-records {
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.consultation-item {
  font-size: 13px;
  color: #666;
  padding: 8px 0;
  line-height: 1.4;
}

.consultation-user {
  color: #1890ff;
  font-weight: 500;
}

/* 底部操作按钮 */
.bottom-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  padding: 16px;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.send-message-btn {
  width: 100%;
  background: linear-gradient(135deg, #1890ff, #096dd9);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.send-message-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

/* 加载状态 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #ff4d4f;
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .doctor-info-card,
  .services-section,
  .reviews-section {
    margin: 12px;
    padding: 16px;
  }
  
  .doctor-name {
    font-size: 20px;
  }
  
  .doctor-avatar {
    width: 60px;
    height: 60px;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .doctor-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .service-item {
    padding: 20px 12px;
  }
  
  .service-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .service-info h4 {
    font-size: 13px;
  }
  
  .service-info p {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .service-item {
    padding: 16px 8px;
  }
  
  .service-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}
